package com.athuahua.security.config;

import io.r2dbc.spi.ConnectionFactories;
import io.r2dbc.spi.ConnectionFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.r2dbc.config.AbstractR2dbcConfiguration;
import org.springframework.data.r2dbc.repository.config.EnableR2dbcRepositories;

@Configuration
@EnableR2dbcRepositories //开启 R2DBC 仓库功能：jap
public class R2DBCConfig extends AbstractR2dbcConfiguration {

  //参考：https://docs.spring.io/spring-data/relational/reference/r2dbc/mapping.html#mapping.configuration
  public ConnectionFactory connectionFactory() {
    return ConnectionFactories.get("io.asyncer:r2dbc-mysql");
  }

//  @Override
//  protected List<Object> getCustomConverters() {
//    return List.of(new BookConverter());
//  }
}